package com.example.sso.server.repository;

import com.example.sso.server.entity.ClientApp;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

@Repository
public class ClientAppRepository {

    private final Map<String, ClientApp> clientApps = new HashMap<>();

    @PostConstruct
    public void init() {
        clientApps.put("c72cd655f17e49ec970e4412084f2358", 
                new ClientApp("c72cd655f17e49ec970e4412084f2358", 
                              "9b6c0a3533b6452f8b6f07f505ed9eca", 
                              "http://localhost:8080/callback"));
    }

    public ClientApp findByClientId(String clientId) {
        return clientApps.get(clientId);
    }
}
    